<template>
    <div class="app">
        <!-- <h2 class="title">Vue路由测试</h2> -->
         <Header></Header>
        <!-- 导航区 -->
         <div class="nav">
            <router-link to="/home" active-class="card">首页</router-link>
            <router-link :to="{name:'xinwen'}" active-class="card">新闻</router-link>
            <router-link replace :to="{path:'/about'}" active-class="card">关于</router-link>
         </div>
         <!-- 展示区 -->
          <div class="main-content">
            <!-- 此处以后可能要展示各种组件， -->
             <router-view></router-view>
          </div>
    </div>
</template>

<script setup lang="ts">
import { RouterView,RouterLink } from 'vue-router';
import Header from './components/Header.vue';

</script>

<style>
* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            color: #333;
            line-height: 1.6;
            min-height: 100vh;
            padding: 20px;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            border-radius: 15px;
            overflow: hidden;
            background: white;
        }
        
        .title {
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            color: white;
            padding: 40px 30px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        .title h1 {
            font-size: 2.8rem;
            margin-bottom: 10px;
            font-weight: 700;
            letter-spacing: 1px;
            text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }
        
        .title p {
            font-size: 1.2rem;
            opacity: 0.9;
            max-width: 600px;
            margin: 0 auto;
        }
        
        .title::before {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
            transform: rotate(30deg);
        }
        
        .nav {
            background: #2c3e50;
            display: flex;
            justify-content: center;
            padding: 0;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
        
        .nav a {
            color: #ecf0f1;
            text-decoration: none;
            padding: 18px 30px;
            font-size: 1.1rem;
            font-weight: 500;
            transition: all 0.3s ease;
            position: relative;
            text-align: center;
            flex: 1;
            max-width: 200px;
        }
        
        .nav a:hover {
            background: #34495e;
            color: #3498db;
        }
        
        .nav a::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 0;
            height: 3px;
            background: #3498db;
            transition: all 0.3s ease;
            transform: translateX(-50%);
        }
        
        .nav a:hover::after {
            width: 80%;
        }
        
        .main-content {
            padding: 40px;
            min-height: 500px;
            background: #f9f9f9;
        }
        
        .content-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
        }
        
        .card {
            background: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        
        .card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
        }
        
        .card-img {
            height: 200px;
            background-size: cover;
            background-position: center;
        }
        
        .card-content {
            padding: 25px;
        }
        
        .card h3 {
            font-size: 1.4rem;
            margin-bottom: 15px;
            color: #2c3e50;
        }
        
        .card p {
            color: #7f8c8d;
            margin-bottom: 20px;
        }
        
        .btn {
            display: inline-block;
            background: #3498db;
            color: white;
            padding: 10px 20px;
            border-radius: 5px;
            text-decoration: none;
            font-weight: 500;
            transition: background 0.3s ease;
        }
        
        .btn:hover {
            background: #2980b9;
        }
        
        @media (max-width: 768px) {
            .nav {
                flex-direction: column;
            }
            
            .nav a {
                max-width: 100%;
            }
            
            .title h1 {
                font-size: 2rem;
            }
            
            .main-content {
                padding: 20px;
            }
        }
</style>